﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>

    <table style="width: 541px">
        <tr>
            <td colspan="2">
            <table>
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="Label1" runat="server" Text="Item"></asp:Label>
                                </td>
                                <td><asp:Label ID="Label2" runat="server" Text="Amount in Grams"></asp:Label></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:DropDownList ID="cboFoodItem" runat="server" Font-Names="Trebuchet MS">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAmount" runat="server" Text="100" Font-Names="Trebuchet MS"></asp:TextBox></td>
                                <td></td>
                                <td> <asp:Button ID="btnAdd" runat="server" Text="Add" Font-Names="Trebuchet MS" onclick="btnAdd_Click" /></td>
                            </tr>
                        </table>
                   </td>
                    <td>
                        <table style="border-left: 1px dotted black">
                            <tr>
                                <td>
                                    <asp:Label ID="Label3" runat="server" Text="Save Config As"></asp:Label>
                                </td>
                                <td></td>
                                <td><asp:Label ID="Label4" runat="server" Text="Load Configuration"></asp:Label></td>                                
                                <td></td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtSaveConfig" runat="server" Font-Names="Trebuchet MS"></asp:TextBox>
                                </td>
                                <td><asp:LinkButton ID="lnkSaveConfig" runat="server" onclick="lnkSaveConfig_Click">Save</asp:LinkButton> </td>
                                <td><asp:DropDownList ID="cboConfigs" runat="server" Font-Names="Trebuchet MS"></asp:DropDownList></td>
                                <td> <asp:LinkButton ID="lnkAddConfig" runat="server" onclick="lnkAddConfig_Click"> Add Config</asp:LinkButton></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            </td>
        </tr>
    <tr>
        <td style="width:40px;"></td>
        <td>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="lnkClear" runat="server" onclick="lnkClear_Click">Clear</asp:LinkButton>
            &nbsp;
            <asp:LinkButton ID="lnkDownload" runat="server" onclick="lnkDownload_Click">Download</asp:LinkButton>
                    
        </td>
    </tr>
    <tr>
        <td style="width:40px;"></td>
        <td>
            <asp:GridView ID="GridView1" runat="server" 
                 Width="1024px" AutoGenerateColumns="False" BackColor="White" 
                BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                GridLines="Horizontal" Font-Names="Trebuchet MS" 
                onrowcommand="GridView1_RowCommand" onrowdatabound="GridView1_RowDataBound" 
                >
                <AlternatingRowStyle BackColor="#F7F7F7" />
                <Columns>
                    <asp:BoundField DataField="NAme" HeaderText="Name" />
                    <asp:BoundField DataField="Amount" HeaderText="Amount(g)" />
                    <asp:BoundField DataField="Energy" HeaderText="Energy (Kcal)" 
                        NullDisplayText="NA">
                    <ControlStyle Width="50px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Protein" HeaderText="Protein(g)" />
                    <asp:BoundField DataField="Fat" HeaderText="Fat(g)" />
                    <asp:BoundField DataField="Carbohydrate" HeaderText="Carb(g)" />
                    <asp:BoundField DataField="Fibre" HeaderText="Fibre(g)" />
                    <asp:BoundField DataField="Iron" HeaderText="Iron(mg)" />
                    <asp:BoundField DataField="Calccium" HeaderText="Calc(mg)" />
                    <asp:BoundField DataField="VitaC" HeaderText="VitC(mg)" />
                    <asp:BoundField DataField="Thiamin" HeaderText="Thiamin(mg)" />
                    <asp:BoundField DataField="Riboflavin" HeaderText="Riboflabin(mg)" />
                    <asp:BoundField DataField="BCarotene" HeaderText="B-Caro(mcg)" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkDelete" runat="server" >[x]</asp:LinkButton>
                            <asp:HiddenField ID="hidFoodCode" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                <SortedAscendingCellStyle BackColor="#F4F4FD" />
                <SortedAscendingHeaderStyle BackColor="#5A4C9D" />
                <SortedDescendingCellStyle BackColor="#D8D8F0" />
                <SortedDescendingHeaderStyle BackColor="#3E3277" />
            </asp:GridView>
        </td>
    </tr>
    <tr>
        <td style="width:40px;"></td>
        <td>

        </td>
    </tr>

</table>
</ContentTemplate>
</asp:UpdatePanel>

</asp:Content>
